package com.gxa.hualianeshop.shiro;

import org.apache.shiro.authc.AuthenticationToken;

/**
 * 为了在鉴权的时候满足AuthenticationToken,
 * 又不能用UsernamePasswordToken(默认用session)
 * 必须设计一个能传递jwt的Token
 * @author bill
 * @date 2023/1/9 10:12
 */
public class JwtToken implements AuthenticationToken {

    private String jwt;

    public JwtToken(String jwt) {
        this.jwt = jwt;
    }

    @Override
    public Object getPrincipal() {
        return jwt;
    }

    @Override
    public Object getCredentials() {
        return jwt;
    }
}
